package org.scboy.common;

import org.scboy.common.cache.DynamicCache;
import org.scboy.common.cache.InterLangCache;
import org.scboy.common.cache.LoginContext;
import org.scboy.common.cache.SystemConfig;
import org.scboy.common.controller.DynamicHttpController;
import org.scboy.common.controller.DynamicServiceController;
import org.scboy.common.controller.DynamicTestController;
import org.scboy.common.dynamic.cache.NodeCache;
import org.scboy.common.init.AppInit;
import org.scboy.common.init.PermissionInit;
import org.scboy.common.loads.LoadDynamic;
import org.scboy.common.loads.LoadInterLang;
import org.scboy.common.loads.LoadLoginUser;
import org.scboy.common.loads.LoadPermission;
import org.scboy.common.loads.LoadSystemConfig;
import org.scboy.common.request.inter.InterScan;
import org.scboy.common.service.DynamicService;
import org.scboy.common.service.LoggerService;
import org.scboy.common.service.imp.DynamicServiceImpl;
import org.scboy.common.service.imp.LoggerServiceImpl;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class CommonAutoConfiguration {
	
	@Bean
	@LoadBalanced
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}
	
	@Bean
	public LoadSystemConfig getLoadSystemConfig() {
		return new LoadSystemConfig();
	}

	@Bean
	public LoadInterLang getLoadInterLang() {
		return new LoadInterLang();
	}
	
	@Bean
	public LoadPermission getLoadPermission() {
		return new LoadPermission();
	}

	@Bean
	public InterLangCache getInterLang() {
		return new InterLangCache();
	}

	@Bean
	public LoadDynamic getLoadDynamic() {
		return new LoadDynamic();
	}
	
	@Bean
	public SystemConfig getSystemConfig() {
		return new SystemConfig();
	}

	@Bean
	public AppInit getAppInit() {
		return new AppInit();
	}
	
	@Bean
	public PermissionInit getPermissionInit() {
		return new PermissionInit();
	}

	@Bean
	public ServerStartReady getServerStartReady() {
		return new ServerStartReady();
	}

	@Bean
	public ServerStartFailed getServerStartFailed() {
		return new ServerStartFailed();
	}

	@Bean
	public DynamicCache getDynamicCache() {
		return new DynamicCache();
	}
	
	@Bean
	public DynamicService getDynamicService() {
		return new DynamicServiceImpl();
	}
	
	@Bean
	public NodeCache getNodeCache() {
		return new NodeCache();
	}

	@Bean
	public DynamicHttpController getDynamicHttpController() {
		return new DynamicHttpController();
	}
	
	@Bean
	public DynamicServiceController getDynamicServiceController() {
		return new DynamicServiceController();
	}
	
	@Bean
	public DynamicTestController getDynamicTestController() {
		return new DynamicTestController();
	}
	
	@Bean
	public InterScan getInterScan() {
		return new InterScan();
	}
	
	@Bean
	public LoadLoginUser getLoadLoginUser() {
		return new LoadLoginUser();
	}
	
	@Bean
	public LoginContext getLoginContext() {
		return new LoginContext();
	}
	
	@Bean
	public LoggerService getLoggerService() {
		return new LoggerServiceImpl();
	}
}
